package com.ruoyi.finance.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.finance.domain.Distributorapp;
import com.ruoyi.finance.mapper.DistributorappMapper;
import com.ruoyi.finance.service.IDistributorappService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 分销员申请表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-11
 */
@Service
public class DistributorappServiceImpl implements IDistributorappService 
{
    @Autowired
    private DistributorappMapper distributorappMapper;

    /**
     * 查询分销员申请表
     * 
     * @param id 分销员申请表主键
     * @return 分销员申请表
     */
    @Override
    public Distributorapp selectDistributorappById(Long id)
    {
        return distributorappMapper.selectDistributorappById(id);
    }

    /**
     * 查询分销员申请表列表
     * 
     * @param distributorapp 分销员申请表
     * @return 分销员申请表
     */
    @Override
    public List<Distributorapp> selectDistributorappList(Distributorapp distributorapp)
    {
        return distributorappMapper.selectDistributorappList(distributorapp);
    }

    /**
     * 新增分销员申请表
     * 
     * @param distributorapp 分销员申请表
     * @return 结果
     */
    @Override
    public int insertDistributorapp(Distributorapp distributorapp)
    {
        distributorapp.setCreateTime(DateUtils.getNowDate());
        return distributorappMapper.insertDistributorapp(distributorapp);
    }

    /**
     * 修改分销员申请表
     * 
     * @param distributorapp 分销员申请表
     * @return 结果
     */
    @Override
    public int updateDistributorapp(Distributorapp distributorapp)
    {
        distributorapp.setUpdateTime(DateUtils.getNowDate());
        return distributorappMapper.updateDistributorapp(distributorapp);
    }

    /**
     * 批量删除分销员申请表
     * 
     * @param ids 需要删除的分销员申请表主键
     * @return 结果
     */
    @Override
    public int deleteDistributorappByIds(Long[] ids)
    {
        return distributorappMapper.deleteDistributorappByIds(ids);
    }

    /**
     * 删除分销员申请表信息
     * 
     * @param id 分销员申请表主键
     * @return 结果
     */
    @Override
    public int deleteDistributorappById(Long id)
    {
        return distributorappMapper.deleteDistributorappById(id);
    }
}
